<?php

namespace backend\controllers;

use backend\queue\Job;
use common\models\User;
use Yii;

class QueueController extends \yii\web\Controller
{
    /**
     * Notes: 测试rabbitmq 队列
     * User: Administrator
     * DateTime: 2021/4/16 16:47
     * @return string
     */
    public function actionQueue()
    {
        $user = User::findOne(1);
        Yii::$app->mqueue->push(new Job([
            'userID' => $user->id
        ]));
        return '成功';
//        return $this->render('queue');
    }

}
